home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb14.zip / TESTINVN.PAS < prev    next >
Pascal/Delphi Source File  |  1985-05-17  |  2KB  |  55 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*                 TestInvN --- Test inverse normal                         *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROGRAM TestInvN;
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*   Program:  TestInvN                                                     *)
  10. (*                                                                          *)
  11. (*   Purpose:  Demonstrate inverse normal routine in PIBSIGS                *)
  12. (*                                                                          *)
  13. (*   Usage:    This program prompts for a tail probability value.           *) )
  14. (*             It computes and prints the corresponding percentage point    *)
  15. (*             of the normal distribution.                                  *)
  16. (*                                                                          *)
  17. (*             To stop the program, enter a negative p-value.               *)
  18. (*                                                                          *)
  19. (*   Calls:    Ninv2                                                        *)
  20. (*                                                                          *)
  21. (*--------------------------------------------------------------------------*)
  22.  
  23. VAR
  24.    Z:    REAL;
  25.    P:    REAL;
  26.    Done: BOOLEAN;
  27.  
  28. (*$I SIGCONST.PAS *)
  29. (*$I ERF.PAS      *)
  30. (*$I SIGNORM.PAS  *)
  31. (*$I NINV.PAS     *)
  32. (*$I NINV2.PAS    *)
  33.  
  34. BEGIN (* TestInvN *)
  35.  
  36.    Done := FALSE;
  37.    ClrScr;
  38.  
  39.    REPEAT
  40.  
  41.       WRITE('Enter tail probability: ');
  42.       READLN( P );
  43.  
  44.       IF ( P > 0.0 ) THEN
  45.          BEGIN
  46.             Z     := Ninv2( P );
  47.             WRITELN('Normal distribution percentage point = ',Z:12:5);
  48.          END
  49.       ELSE
  50.          Done := TRUE;
  51.  
  52.    UNTIL Done;
  53.  
  54.  
  55. END   (* TestInvN *).